﻿<UserControl x:Class="Views.ViewTarif"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:VMtxgar="clr-namespace:OMANE.Modules.TauxGarantis.ViewModels"
             xmlns:Theme="clr-namespace:OMANE.Common.UI.Theme;assembly=OMANE.Common.UI.Theme"
             xmlns:Actuariat="clr-namespace:Actuariat;assembly=Actuariat"
             DataContext="{Binding Source={x:Static VMtxgar:Locator.ViewModelTarifStatic}}"
             mc:Ignorable="d" 
             xml:lang="fr-FR"
             d:DesignHeight="300" d:DesignWidth="700">
    
    <UserControl.Resources>
        <DataTemplate x:Key="ListeTrTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=strNomTable}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid Margin="20,10,20,10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="110" Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="10"></ColumnDefinition>
            <ColumnDefinition MinWidth="110" Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="10"></ColumnDefinition>
            <ColumnDefinition MinWidth="110" Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        
        <!-- Mensualité -->
        <TextBlock Margin="0,2,0,2"
                   Text="Echéance mensuelle"
                   VerticalAlignment="Center" 
                   Grid.Column="0" 
                   Grid.Row="0" />
        <TextBlock Visibility="{Binding MensualiteIsVisible}" Margin="0,2,0,2" Text="{Binding Mensualite}" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0"></TextBlock>
        <!-- Table de mortalité -->
        <TextBlock Margin="0,2,0,2" Text="Table de mortalité"
                   VerticalAlignment="Center" Grid.Column="3" Grid.Row="0" />
        <ComboBox Margin="0,2,0,2" ItemsSource="{Binding TablesMortalite}"
                  SelectedItem="{Binding TablesMortalite_Selected}"
                  Style="{StaticResource OMANE_cbx}" 
                  VerticalAlignment="Center" 
                  Grid.Column="4" 
                  Grid.Row="0"></ComboBox>
        <!-- Table de maintien en INCAP / INVAL -->
        <TextBlock Margin="0,2,0,2" TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="0">Maintien INCAP / INVAL</TextBlock>
        <ComboBox  Margin="0,2,0,2" ItemsSource="{Binding TablesMaintienINCINV}"
                   SelectedItem="{Binding TableMaintienINCINV_Selected}"
                   Style="{StaticResource OMANE_cbx}"
                   VerticalAlignment="Center" 
                   Grid.Column="7" 
                   Grid.Row="0"></ComboBox>
        <!-- Durée du contrat -->
        <TextBlock  Margin="0,2,0,2" TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1">Durée du contrat</TextBlock>
        <Theme:NumericEditor Style="{StaticResource DureeMoisEditor}" Width="Auto" 
                             Margin="0,2,0,2"
                             Value="{Binding MoteurEcheancier.LongueurProj}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="1"></Theme:NumericEditor>
        <!-- Taux nominal annuel -->
        <TextBlock  Margin="0,2,0,2" TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2">Taux nominal annuel</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" 
                             Width="Auto"  
                             Margin="0,2,0,2" 
                             Value="{Binding TxNomAnnuel}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="2"></Theme:NumericEditor>
        <!-- Capital initial -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3">Capital initial</TextBlock>
        <Theme:NumericEditor Style="{StaticResource EurosEditor}"  
                             Width="Auto"  
                             Margin="0,2,0,2" 
                             Value="{Binding MoteurEcheancier.CapIni}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="3"></Theme:NumericEditor>
        <!-- Age initial de l'assuré -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4">Age initial de l'assuré</TextBlock>
        <Theme:NumericEditor Style="{StaticResource AgeEditor}" 
                             Width="Auto"  
                             Margin="0,2,0,2" 
                             Value="{Binding MoteurEcheancier.AgeInit}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="4"></Theme:NumericEditor>
        <!-- Nombre initial d'assurés -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="5">Nombre initial d'assurés</TextBlock>
        <Theme:NumericEditor Style="{StaticResource NumberEditor}" 
                             Width="Auto"  
                             Margin="0,2,0,2" 
                             Value="{Binding MoteurEcheancier.NbInitAssures}" 
                             VerticalAlignment="Center" Grid.Column="1" 
                             Grid.Row="5"></Theme:NumericEditor>
        <!-- Frais de gestion -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="6">Frais de gestion</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" 
                             Width="Auto"  
                             Margin="0,2,0,2" 
                             Value="{Binding MoteurEcheancier.TxFG}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="6"></Theme:NumericEditor>
        <!-- Taux technique -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7">Taux technique</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" 
                             Width="Auto" 
                             Margin="0,2,0,2" 
                             Value="{Binding TxTechAnnuel}" 
                             VerticalAlignment="Center" 
                             Grid.Column="1" 
                             Grid.Row="7"></Theme:NumericEditor>
        <!-- Taux d'entrée en INCAP / INVAL -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="1">Taux d'entrée en INC/INV</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" 
                             Value="{Binding MoteurEcheancier.TxEntreeINCINV}" 
                             Width="Auto" 
                             Margin="0" 
                             VerticalAlignment="Center" 
                             Grid.Column="4" 
                             Grid.Row="1"></Theme:NumericEditor>
        <!-- Tarif INCAP / INVAL -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="2">Tarif INC/INV (% du CI)</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" 
                             Format="0.000%" 
                             Width="Auto" 
                             Margin="0" 
                             Value="{Binding TarifINCINVAn}" 
                             VerticalAlignment="Center" 
                             Grid.Column="4" 
                             Grid.Row="2"></Theme:NumericEditor>
        <!-- Tarif DC -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="3">Tarif DC (% du CI)</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Format="0.000%" Width="Auto"  Margin="0,2,0,2" Value="{Binding TarifDCAn}" VerticalAlignment="Center" Grid.Column="4" Grid.Row="3"></Theme:NumericEditor>
        <!-- Taxe non vie -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="4">Taxe Non Vie</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.TxTaxeINCINV}" VerticalAlignment="Center" Grid.Column="4" Grid.Row="4"></Theme:NumericEditor>
        <!-- Age fin DC -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="5">Age fin DC</TextBlock>
        <Theme:NumericEditor Style="{StaticResource AgeEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.AgeFinDC}" VerticalAlignment="Center" Grid.Column="4" Grid.Row="5"></Theme:NumericEditor>
        <!-- Age fin INC/INV -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="6">Age fin INC/INV</TextBlock>
        <Theme:NumericEditor Style="{StaticResource AgeEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.AgeFinINCINV}" VerticalAlignment="Center" Grid.Column="4" Grid.Row="6"></Theme:NumericEditor>
        <!-- Taux annuel de remboursements anticipés -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="1">Taux annuel de RA</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding TxRAAnnuel}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="1"></Theme:NumericEditor>
        <!-- Rémunération assureur -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="2">Rémunération partenaire</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.TxComPartenaire}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="2"></Theme:NumericEditor>
        <!-- Abattement MNO -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="3">Abt MNO</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto" Margin="0" Value="{Binding MoteurEcheancier.AbtMNO}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="3"></Theme:NumericEditor>
        <!-- Abattement perte de revenus -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="4">Abt Perte Revenus</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.AbtPerteRev}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="4"></Theme:NumericEditor>
        <!-- MAJ sinistres DC -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="5">MAJ sinistres DC</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.MajSinDC}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="5"></Theme:NumericEditor>
        <!-- MAJ sinistres INC/INV -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="6">MAJ sinistres INC/INV</TextBlock>
        <Theme:NumericEditor Style="{StaticResource PercentageEditor}" Width="Auto"  Margin="0,2,0,2" Value="{Binding MoteurEcheancier.MajSinINCINV}" VerticalAlignment="Center" Grid.Column="7" Grid.Row="6"></Theme:NumericEditor>
        <!-- Sélection médicale -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="3" Grid.Row="7">Sélection médicale</TextBlock>
        <Button Command="{Binding cmdSelectionMedicale}" Grid.Row="7" VerticalAlignment="Center" Grid.Column="4"  Margin="0,2,0,2">Paramétrage</Button>
        <!-- Vision -->
        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Grid.Column="6" Grid.Row="7">Vision</TextBlock>
        <Grid Grid.Column="7" Grid.Row="7">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Command="{Binding CmdChangePasProjection}" 
                    Margin="0,0,2,0" 
                    Content="{Binding PasProjection}" 
                    VerticalAlignment="Center"
                    Grid.Column="0"/>
            <Button Command="{Binding cmdTypeRecalcul}" 
                    Margin="2,0,0,0" 
                    Content="{Binding Recalcul}" 
                    VerticalAlignment="Center"
                    Grid.Column="1"
                    Grid.ColumnSpan="{Binding RecalculColumnSpan}"/>
            <Button Command="{Binding cmdCalculer}"
                    Visibility="{Binding CalculerIsVisible}"
                    Margin="4,0,0,0" 
                    Content="Calc." 
                    VerticalAlignment="Center"
                    Grid.Column="2"/>
        </Grid>        
        <DataGrid xml:lang="fr-FR" Name="DgvProjMensuelle" 
                  ClipboardCopyMode="IncludeHeader"
                  Visibility="{Binding EcheancierMensuelIsVisible}"
                  ItemsSource="{Binding EcheancierMensuel}"
                  AutoGenerateColumns="False"
                  IsReadOnly="True"
                  Margin="0,10,0,10" 
                  Grid.Row="8" 
                  Grid.Column="0"
                  Grid.ColumnSpan="8"
                  ColumnHeaderHeight="70">
            <DataGrid.Columns>

                <!-- N° Année -->
                <DataGridTextColumn Width="50">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="N° année" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="NumAnnee" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- N° Mois -->
                <DataGridTextColumn Width="50">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="N° Mois" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="NumMois" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Capital restant dû en début de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Capital restant dû en début de période" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="EchDeb" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Capital restant dû en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Capital restant dû en fin de période" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="EchFin" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Age moyen pondéré en milieu de période -->
                <DataGridTextColumn Width="115">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Age moyen pondéré en milieu de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="AgeActuMilPer" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Taux de mortalité pondéré en milieu de période -->
                <DataGridTextColumn Width="120">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Taux de mortalité moyen pondéré en milieu de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="TxMortMilPer" StringFormat="0.0000%" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de cotisants en début de période -->
                <DataGridTextColumn Width="115">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de cotisants en début de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="NbCotisantsDebPer" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de cotisants en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de cotisants en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="nbCotisants" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de sinistres DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de sinistres DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="nbSinDC" StringFormat="N1" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de sinistres INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de sinistres INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="NbSinistresINCAPINVALFinPer" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes commerciales INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes commerciales INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="CotisCommINCINV" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes commerciales DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes commerciales DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="CotisCommDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Marge de solvabilité règlementaire vie -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Marge de solvabilité règlementaire Vie" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="MSR_Vie" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes techniques INC/INV -->
                <DataGridTextColumn  Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes techniques INC/INV" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="CotisTechINCINV" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes techniques DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes techniques DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="CotisTechDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Sinistres réglés DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Sinistres réglés DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="SinRegDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Sinistres réglés INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Sinistres réglés INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="SinRegINCINV" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM de rente fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM de rente en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="projPMRente" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PPRC théorique en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PPRC théorique en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="ProjPPRC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM DC en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM DC en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="ProjPMDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM INCAP / INVAL en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM INCAP / INVAL en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="projPMINCINV" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Capitaux sous risque DC en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Capitaux sous risque DC en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="ProjCSRDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>
                
            </DataGrid.Columns>
        </DataGrid>
        <DataGrid  xml:lang="fr-FR" Name="DgvProjAnnuelle"
                  ClipboardCopyMode="IncludeHeader"
                  Visibility="{Binding EcheancierAnnuelIsVisible}"
                  ItemsSource="{Binding EcheancierAnnuel}"
                  AutoGenerateColumns="False"
                  IsReadOnly="True"
                  Margin="0,10,0,10" 
                  Grid.Row="8" 
                  Grid.Column="0"
                  Grid.ColumnSpan="8"
                  ColumnHeaderHeight="70">
            <DataGrid.Columns>

                <!-- N° Année -->
                <DataGridTextColumn Width="50">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="N° année" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="numAnnee" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Capitaux sous risque DC en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Capitaux sous risque DC en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="CSRDCfin" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes commerciales DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes commerciales DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="cotisDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Sinistres réglés DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Sinistres réglés DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="sinDC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM DC en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM DC en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="PM_DCtheo" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Primes commerciales INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Primes commerciales INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="cotisIT" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Sinistres réglés INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Sinistres réglés INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="sinIT" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM de rente fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM de rente en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="PM_Rente" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PPRC théorique en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PPRC théorique en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="PPRC" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- PM INCAP / INVAL en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="PM INCAP / INVAL en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="PM_ITtheo" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de cotisants en fin de période -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de cotisants en fin de période" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="nbCotisants" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de sinistres DC -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de sinistres DC" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="nbSinDC" StringFormat="N1" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Nombre de sinistres INCAP/INVAL -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Nombre de sinistres INCAP/INVAL" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="NbSinistresINCAPINVALFinPer" StringFormat="N2" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>

                <!-- Marge de solvabilité règlementaire vie -->
                <DataGridTextColumn Width="95">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Marge de solvabilité règlementaire Vie" TextWrapping="Wrap" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="MSR_Vie" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>
                
            </DataGrid.Columns>
        </DataGrid>
        <TextBlock Grid.Row="8" 
                   Grid.Column="0"
                   Grid.ColumnSpan="8"
                   Margin="0,10,0,0"
                   Visibility="{Binding MessageIsVisible}">Mode de recalcul : manuel - Appuyez sur Calc. pour lancer les calculs</TextBlock>
    </Grid>
</UserControl>